.logo {
    width: $sidebar-width;
    max-width: $sidebar-width;
    height: $navbar-height;
    float: left;
    background: $navbar-color url('../images/organization_logo.png') no-repeat center center;

    &.logo-collapsed {
        width: $sidebar-width-collapsed;
        max-width: $sidebar-width-collapsed;
        background: $navbar-color url('../images/organization_logo_small.png') no-repeat center center;
    }
}

.navbar .nav li.dropdown.active > .dropdown-toggle {
    background-color: transparent;
}

@media screen and (max-width: 980px) {
    .navbar-fixed-top {
        position: fixed;
        margin: 0;
    }
}

&.is-at-top .navbar {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, .1);
}

.navbar {
    height: $navbar-height;
    background: $white;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, .1);

    & > .motd {
        padding: 20px;
        background: $sidebar-background;
        color: #ffffff;
        font-family: 'SourceSansPro', 'Helvetica Neue', Arial, sans-serif;
        font-size: 16px;
        line-height: 26px;
        text-align: center;

        a {
            color: $white;
            text-decoration: underline;
        }

        button {
            margin: 0;
        }
    }
}

@media screen and (max-width: 880px) {
    .navbar {
        height: $navbar-height * 2;
    }
}

@media screen and (max-width: 650px) {
    .navbar {
        height: $navbar-height * 3;
    }
}

.navbar .navbar-inner {
    min-height: $navbar-height;
    padding: 0;
    border: 0;
    background: $white;
    color: $white;
    font-family: 'SourceSansPro', 'Helvetica Neue', Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    filter: none;
    box-shadow: none;

    #dropdown-project, #dropdown-help {
        letter-spacing: normal;
        text-transform: none;
    }

    .user-menu {
        font-size: 14px;
        letter-spacing: normal;
        text-transform: none;
    }

    .admin-link {
        color: #da5353;
    }

    .icon {
        font-size: 16px;
    }

    .container-fluid {
        padding: 0;
    }

    .brand {
        padding: 0;
    }

    .nav {
        height: $navbar-height;

        & > li {
            display: flex;
            align-items: center;
            height: $navbar-height;

            .join-tuleap-community {
                padding: 12px 10px 10px 0;
            }
        }

        & > li > a {
            height: $navbar-height - 12px - 5px;
            padding: 13px 15px 5px;
            text-align: center;
        }

        .nav-form {
            margin-bottom: 0;
        }

        .nav-form-button {
            padding: 0 15px;
            border: 0;
            background: $white;
            color: #747474;

            &:hover, &:focus {
                outline: none;
                color: $navbar-color;
            }
        }

        li:hover > a, li:hover > a:hover, li:hover > a:focus,
        li.active > a, li.active > a:hover, li.active > a:focus,
        li.dropdown.active > .dropdown-toggle {
            color: $navbar-color;
            box-shadow: none;
        }

        li.dropdown.active > .dropdown-toggle .caret,
        li.dropdown:hover > .dropdown-toggle .caret,
        li.dropdown.open > .dropdown-toggle .caret,
        li.dropdown.open.active > .dropdown-toggle .caret {
            border-top-color: $navbar-color;
            border-bottom-color: $navbar-color;
        }

        li.dropdown.open > .dropdown-toggle, li.dropdown.open.active > .dropdown-toggle {
            background-color: $white;
            color: $navbar-color;
        }

        li > a.username {
            max-width: 250px;
            text-overflow: ellipsis;
            white-space: nowrap;
            overflow: hidden;
            display: flex;
            padding: 0 20px 0 10px;
            height: 100%;
            align-items: center;
            line-height: normal;
        }

        .user-infos {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
        }

        .user-infos-real-name {
            color: $navbar-color;
        }

        .user-infos-login-name {
            font-size: 12px;
            font-weight: 400;
        }

        .fa-clock-o {
            position: relative;
            top: 1px;
        }

        .fa-cog {
            position: relative;
            top: 1.5px;
            font-size: 16px;
        }

        @media screen and (max-width: 1250px) {
            .user-infos {
                display: none;
            }
        }

        li.current-project {
            margin: 0 -10px 0 0;
            padding: 0 20px;
            border-right: 1px solid #e3e5ed;

            > a {
                box-sizing: border-box;
                max-width: 250px;
                height: auto;
                padding: 0;
                overflow: hidden;
                background-color: $white;
                color: $navbar-color;
                font-size: 16px;
                font-weight: normal;
                letter-spacing: .5px;
                text-align: left;
                text-overflow: ellipsis;
                white-space: nowrap;

                > i {
                    margin-right: 5px;
                    font-size: 16px;
                }
            }

            &:hover > a:hover,
            &:focus > a:focus {
                color: $navbar-color;
            }
        }

        ul.dropdown-menu {
            top: $navbar-height - 1px;
            min-width: 100%;
            padding: 0;
            border: 0;
            border-radius: 0;
            background-color: $white;

            &:before, &:after {
                content: none;
            }

            li:first-child {
                margin-top: 0;
            }

            li:last-child {
                margin-bottom: 0;
            }

            li > a, .submit-action {
                display: block;
                padding: 10px 20px;
                clear: both;
                color: #747474;
                font-size: 14px;
                font-weight: normal;
                line-height: $baseLineHeight;
                white-space: nowrap;

                &:hover a {
                    text-decoration: none;
                }
            }

            li > a:hover, li > a:focus,
            .submit-action:hover, .submit-action:focus,
            .dropdown-submenu:hover > a, .dropdown-submenu:focus > a {
                background: transparentize($main, .9);
                color: $navbar-color;
                text-decoration: none;
                filter: none;
            }

            li > form {
                display: flex;
                margin: 0;

                .submit-action {
                    flex-grow: 1;
                    border: 0;
                    background-color: transparent;
                    font-family: inherit;
                    text-align: left;
                }
            }

            .divider {
                border: 0;
                background-color: #f3f3f3;
            }

            &.user-navbar-history {
                min-width: 0;
                right: 120px;
                width: auto;
                font-size: 14px;
                font-weight: normal;
                letter-spacing: normal;
                text-transform: none;
            }
        }

        @import 'navbar-dropdown-history';

        .projects-nav {
            margin: 0 0 0 10px;

            ul.dropdown-menu {
                width: 300px;
                max-height: 590px;
                overflow: hidden;

                #filter-projects {
                    width: 87%;
                    height: 30px;
                    margin: 10px auto;
                    padding: 0 15px;
                    display: block;
                    border-radius: 20px;
                    box-sizing: border-box;

                    &:focus {
                        box-shadow: none;
                        border-color: $navbar-color;
                    }
                }
            }
        }
    }

    .user-avatar {
        width: 36px;
        height: 36px;
        margin: 0 10px 0 0;
        border-radius: 50%;
    }

    .navbar-search {
        margin: 9px 10px 0 0;

        input[type="text"] {
            width: 144px;
            height: 26px;
            padding: 0 10px;
            border-radius: 14px;
            box-shadow: none;

            &:focus {
                z-index: 0;
                border: 1px solid $navbar-color-hover;
            }
        }

        .btn {
            background-color: $dark-main;
            background-image: -moz-linear-gradient(top, lighten($dark-main, 10%), $dark-main);
            background-image: -webkit-gradient(linear, 0 0, 0 100%, from(lighten($dark-main, 10%)), to($dark-main));
            background-image: -webkit-linear-gradient(top, lighten($dark-main, 10%), $dark-main);
            background-image: -o-linear-gradient(top, lighten($dark-main, 10%), $dark-main);
            background-image: linear-gradient(to bottom, lighten($dark-main, 10%), $dark-main);
            border: 1px solid $dark-main;
            border-color: $dark-main;
            border-bottom-color: darken($dark-main, 5%);
            padding: 3px 18px 5px;

            i {
                color: #ffffff;
                text-shadow: 0 1px 2px lighten($dark-grey, 25%);
            }
        }

        .input-append {
            margin-bottom: 0;
        }
    }
}

.join-tuleap-community-container {
    border-right: 1px solid #e3e5ed;
}

.join-tuleap-community-svg {
    fill: $navbar-color;
}

.header-navbar-container {
    display: flex;
    justify-content: space-between;

    &:before,
    &:after {
        content: none;
    }
}

.header-navbar-container-project-nav,
.header-navbar-container-user-nav {
    display: flex;
}

#navbar-help,
#navbar-project {
    display: flex;

    > .caret {
        margin-left: 5px;
    }
}
